#ifndef __LIB_AGORA_ADMIN_RIGHTMANAGER_H__
#define __LIB_AGORA_ADMIN_RIGHTMANAGER_H__

#include <map>
#include <string.h>
#include "AdminIRightManager.h"


namespace AgoraAdmin
{

	class RightManager : public IRightManager
	{
	public:
		static IRightManager*		GetRightManager();
		const IChannelRight&		GetChannelRight(IUser* user, IChannel* channel);
		void						SetChannelRight(IUser* user, IChannel* channel, const bool canCreate, const bool canDelete, const bool canEdit, const bool canEditUser, const bool canTalk, const bool canWrite, const bool canKick, const bool canBan);
		void						RemoveChannelRight(IUser* user, IChannel* channel);
		void						RemoveChannelRight(IChannel* channel);
		void						RemoveChannelRight(IUser* user);
		const IHostRight&			GetHostRight(IUser* user);
		void						SetHostRight(IUser* user, const bool canChangeLogin, const bool canChangePassword, const bool canChangeChannel, const bool canCreateChannel, const bool canDeleteChannel, const bool canMoveChannel, const bool canKickUser, const bool canBanUser, const bool canEditUser);
		void						RemoveHostRight(IUser* user);

	private:
		RightManager();
		static IRightManager*									_instance;
		std::map<IUser*, std::map<IChannel*, IChannelRight*> >	_userChannelRight;
		std::map<IUser*, IHostRight*>							_userHostRight;
	};

}

#endif
